package HLLib.purchase;

import HLCode.HLClass;
import HLCode.HLClassManager;
import HLCode.HLClassManager_H;
import HLCode.HLLibObject;
import HLLib.base.HLICallback;
import HLLib.base.HLList;
import HLLib.base.HLString;

public class HLPurchase extends HLLibObject implements HLICallback {
    public HLClass GetClass(HLClassManager classManager) {
        return classManager.GetLibClass(HLClassManager_H.CLASS_GROUP_TYPE_LIB_PURCHASE, HLClassManager_H.LIB_CLASS_PURCHASE_Purchase);
    }

    public static void GetProducts(HLList productsId) {
        HLList products = new HLList();
        for (int i = 0; i < productsId.Count(); i++) {
            HLProduct product = new HLProduct();
            HLString productId = (HLString) productsId.items[i];
            product.name = new HLString("product" + productId.string);
            product.indenty = productId;
            product.des = new HLString("des");
            product.price = new HLString("0.99");
            product.localeCurrencySymbol = new HLString("$");
            products.Add(product);
        }
        curRun.CallbackSuccess(CALLBACK_PURCHASE_GET_PRODUCTS, products);
    }

    public static void PayProduct(HLString productId, int count) {
        HLTransaction transaction = new HLTransaction();
        transaction.transaction = new HLString(
                "ewoJInNpZ25hdHVyZSIgPSAiQW02a3NoQ2dzUDF2YmhOZTMxOFZKZG1VMWdibStlNmNDbmlnWFpzVU1EUVF5Z3BnZVI2UkQxOFh4SERPaXpoQnpzTDJlTXZuYlZuNTNXaEFUVEo0NnZmcWdkVnBkeGcrRVdYZjh4QVRZdEFMb2tLWitnWW93bFhRYnphcDl6Kzh2TTNGb2V5cUVsb1BKUnZZc2FJN2lRcjFxeUoyaUcyZ3RTTVlwSmE5UjdMaEFBQURWekNDQTFNd2dnSTdvQU1DQVFJQ0NHVVVrVTNaV0FTMU1BMEdDU3FHU0liM0RRRUJCUVVBTUg4eEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVNZd0pBWURWUVFMREIxQmNIQnNaU0JEWlhKMGFXWnBZMkYwYVc5dUlFRjFkR2h2Y21sMGVURXpNREVHQTFVRUF3d3FRWEJ3YkdVZ2FWUjFibVZ6SUZOMG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5QTTN3b3hoZDNnU1JMdlhqK2xvSHNTdGNURXFlOXBCRHBtRzUrc2s0dHcrR0szR01lRU41LytlMVFUOW5wL0tsMW5qK2FCdzdDMHhzeTBiRm5hQWQxY1NTNnhkb3J5L0NVdk02Z3RLc21uT09kcVRlc2JwMGJzOHNuNldxczBDOWRnY3hSSHVPTVoydG04bnBMVW03YXJnT1N6UT09IjsKCSJwdXJjaGFzZS1pbmZvIiA9ICJld29KSW1sMFpXMHRhV1FpSUQwZ0lqUXpPVFl3T0Rrd015STdDZ2tpYjNKcFoybHVZV3d0ZEhKaGJuTmhZM1JwYjI0dGFXUWlJRDBnSWpFd01EQXdNREF3TURNNU16UXpOellpT3dvSkluQjFjbU5vWVhObExXUmhkR1VpSUQwZ0lqSXdNVEV0TURjdE1qQWdNRFk2TkRjNk1qa2dSWFJqTDBkTlZDSTdDZ2tpY0hKdlpIVmpkQzFwWkNJZ1BTQWlNVEF5TURFaU93b0pJblJ5WVc1ellXTjBhVzl1TFdsa0lpQTlJQ0l4TURBd01EQXdNREF6T1RNME16YzJJanNLQ1NKeGRXRnVkR2wwZVNJZ1BTQWlNU0k3Q2draWIzSnBaMmx1WVd3dGNIVnlZMmhoYzJVdFpHRjBaU0lnUFNBaU1qQXhNUzB3TnkweU1DQXdOam8wTnpveU9TQkZkR012UjAxVUlqc0tDU0ppYVdRaUlEMGdJbU52YlM1emIzUnZaRzh1ZDI5eklqc0tDU0ppZG5KeklpQTlJQ0l4TGpBaU93cDkiOwoJImVudmlyb25tZW50IiA9ICJTYW5kYm94IjsKCSJwb2QiID0gIjEwMCI7Cgkic2lnbmluZy1zdGF0dXMiID0gIjAiOwp9");
        curRun.CallbackSuccess(CALLBACK_PURCHASE_PAY, transaction);
    }

    public static void PayProductNet(HLString productId, int count) {
        HLTransaction transaction = new HLTransaction();
        transaction.productID = productId;
        transaction.transaction = new HLString(
                "ewoJInNpZ25hdHVyZSIgPSAiQW02a3NoQ2dzUDF2YmhOZTMxOFZKZG1VMWd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0k3Q2draWIzSnBaMmx1WVd3dGNIVnlZMmhoYzJVdFpHRjBaU0lnUFNBaU1qQXhNUzB3TnkweU1DQXdOam8wTnpveU9TQkZkR012UjAxVUlqc0tDU0ppYVdRaUlEMGdJbU52YlM1emIzUnZaRzh1ZDI5eklqc0tDU0ppZG5KeklpQTlJQ0l4TGpBaU93cDkiOwoJImVudmlyb25tZW50IiA9ICJTYW5kYm94IjsKCSJwb2QiID0gIjEwMCI7Cgkic2lnbmluZy1zdGF0dXMiID0gIjAiOwp9");
        curRun.CallbackSuccess(CALLBACK_PURCHASE_PAY, transaction);
    }

    public static void FinishPay(HLTransaction transaction) {
    }

    public static void StartObservePuerchase() {

    }
    public static void Restore() {
        
    }
    public static void Check(HLTransaction transaction) {
        curRun.CallbackSuccess(CALLBACK_PURCHASE_PAY_CHECK_SUCCESS, transaction);   
    }
}
